﻿<navigation:Page xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
     xmlns:DV="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Compatible;assembly=System.Windows.Controls.DataVisualization.Toolkit"
     xmlns:DVC="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit"
     xmlns:DVCC="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Toolkit"
                 
  xmlns:Converters="clr-namespace:caedisi.Converters"
  xmlns:Helpers="clr-namespace:caedisi.Helpers"
  xmlns:my="clr-namespace:caedisi.Views.Controls"
                 xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
  x:Class="caedisi.Home"
                 
  mc:Ignorable="d" d:DesignWidth="840" d:DesignHeight="480"
  DataContext="{Binding RelativeSource={RelativeSource Self}}"
                 >

    <navigation:Page.Resources>
        <Converters:ColorToBrushConverter x:Name="ColorToBrushConverter"/>
        <Helpers:GlobalVariableProvider x:Key="GlobalVariableProvider" />
    </navigation:Page.Resources>

    <navigation:Page.Style>
        <StaticResource ResourceKey="PageStyle"/>
    </navigation:Page.Style>

    <Grid x:Name="LayoutRoot" >
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Horizontal" FlowDirection="LeftToRight">
            <Button Content="New" Click="ButtonNewCellularAutomata_Click" x:Name="ButtonNewCellularAutomata" />
            <Button Content="Open" x:Name="ButtonOpen" Click="ButtonOpen_Click" />
            <Button x:Name="ButtonSave" Content="Save" Click="ButtonSave_Click" />
            <Button Content="Print" IsEnabled="False" />
            <Button Content="Export" IsEnabled="False" />
            <!--<Button Name="dec" Content="Decompose" Width="75" Click="B_Click"/>-->
            <Rectangle Width="100"/>
            <Button Content="Show Recorded Execution" Click="ButtonShowRecorded_Click" Width="160"/>
        </StackPanel>

        <!--<ScrollViewer  Grid.Row="1" x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}">-->
        <Grid  Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>

            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <StackPanel  Grid.Column="0">
                <sdk:Label  Content="Topology" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,0,25,0"/>
                <Grid >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="10" />
                        <RowDefinition Height="7" />
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <sdk:Label Grid.Row="0" Grid.Column="0"   Content="Width" HorizontalAlignment="Left" />
                    <TextBox Grid.Row="0" Grid.Column="1" Height="23" HorizontalAlignment="Left"  x:Name="textBoxNumberOfRows" VerticalAlignment="Top" Width="40"  Text="{Binding CurrentCellularAutomata.Width, Mode=TwoWay, NotifyOnValidationError=True}" IsEnabled="{Binding IsNeighbourhoodTypeEnabled, Mode=TwoWay}"/>
                    <sdk:Label Grid.Row="0" Grid.Column="2"   Content="Height" HorizontalAlignment="Left"  />
                    <TextBox Grid.Row="0" Grid.Column="3" Height="23" HorizontalAlignment="Left"  x:Name="textBoxNumberOfColumns" VerticalAlignment="Top" Width="40" Margin="0,0,25,0" Text="{Binding CurrentCellularAutomata.Height, Mode=TwoWay, NotifyOnValidationError=True}" />
                    <CheckBox Grid.Row="1" Grid.ColumnSpan="4" Content="Circular Horizontal" IsChecked="{Binding CurrentCellularAutomata.CircularHorizontal, Mode=TwoWay, NotifyOnValidationError=True}"/>
                    <CheckBox Grid.Row="2" Grid.ColumnSpan="4" Content="Circular Vertical" IsChecked="{Binding CurrentCellularAutomata.CircularVertical, Mode=TwoWay, NotifyOnValidationError=True}" Grid.RowSpan="2" />
                    <sdk:Label Grid.Row="4" Grid.ColumnSpan="2" Content="Immunity time" HorizontalAlignment="Left"  />
                    <TextBox Grid.Row="4" Grid.Column="2" Height="23" HorizontalAlignment="Left"  x:Name="ImmunityTime" VerticalAlignment="Top" Width="30" Text="{Binding CurrentCellularAutomata.ImmunityTime, Mode=TwoWay, NotifyOnValidationError=True}" />

                </Grid>
                <Button x:Name="Refresh" Content="Refresh" Click="Refresh_Click" />
            </StackPanel>

            <sdk:GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" IsEnabled="{Binding IsGridSplitterEnabled, Mode=TwoWay}" Visibility="{Binding IsGridSplitterVisible, Mode=TwoWay}" />

            <ScrollViewer  Grid.Column="2" x:Name="CanvasScrollViewer" Style="{StaticResource PageScrollViewerStyle}" Padding="0">
                <!-- Start Canvas -->
                <Grid x:Name="GridCellularAutomata" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="30"/>
                <!-- End Canvas -->
            </ScrollViewer>
            <StackPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal" FlowDirection="LeftToRight" Grid.ColumnSpan="3" Margin="0,10,0,10">
                <Button x:Name="ButtonResetAllCellState" Content="Reset all Cells" Click="ButtonResetAllCellState_Click" Visibility="{Binding IsThisVisible, Mode=TwoWay}" />
                <my:BasicCellControl x:Name="BasicCellControlResetState" Grid.Row="2" Grid.Column="5"  VerticalAlignment="Center" HorizontalAlignment="Center" Height="25" Width="29" Visibility="{Binding IsThisVisible, Mode=TwoWay}" />
                <Rectangle Width="57" />
                <Button x:Name="ButtonPlay" Content="Play" Click="ButtonPlay_Click" Visibility="{Binding IsThisVisible, Mode=TwoWay}" RenderTransformOrigin="-1.897,0.6" />
                <Button Content="Pause" x:Name="ButtonPause" Click="ButtonPause_Click" Visibility="{Binding IsThisVisible, Mode=TwoWay}" />
                <Rectangle Width="50" />
                <Button Content="First" x:Name="ButtonFirstStep" Click="ButtonFirstStep_Click" Visibility="{Binding IsThisVisible, Mode=TwoWay}" />
                <Button Content="Previous" x:Name="ButtonPreviousStep" Click="ButtonPreviousStep_Click" Visibility="{Binding IsThisVisible, Mode=TwoWay}" />
                <TextBox Text="{Binding CurrentSimulation.CurrentStep, Mode=TwoWay, NotifyOnValidationError=True}"  Width="40" IsEnabled="False" Visibility="{Binding IsThisVisible, Mode=TwoWay}"/>
                <Button Content="Next" x:Name="ButtonNextStep"  Click="ButtonNextStep_Click" Visibility="{Binding IsThisVisible, Mode=TwoWay}" />
                <Button Content="Last" x:Name="ButtonLastStep" Click="ButtonLastStep_Click" Visibility="{Binding IsThisVisible, Mode=TwoWay}" />
                <Rectangle Width="39" />
                <Button Content="Record" x:Name="ButtonRecordStep" Click="RecordStep_Click" IsEnabled="{Binding IsRecordEnabled, Mode=TwoWay}" Visibility="{Binding IsThisVisible, Mode=TwoWay}"/>
            </StackPanel>

            <sdk:GridSplitter  Grid.Column="3" HorizontalAlignment="Stretch" x:Name="GridSplitterRightPanel" IsEnabled="True" Visibility="{Binding IsGridSplitterSimulationVisible, Mode=TwoWay}" />
            <sdk:TabControl Grid.Column="4" HorizontalAlignment="Stretch" x:Name="TabControlCellularAutomataAndSimulationInfo" Visibility="{Binding IsGridSplitterSimulationVisible, Mode=TwoWay}" >
                <sdk:TabItem Header="Simulation Info" x:Name="TabItemSimulationInfo">
                    <Grid x:Name="GridSimulationInfo" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <!--<Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>-->

                        <StackPanel Margin="0,20">
                            <Button  Content="View Parameters"  x:Name="ButtonEditCAParameters" Click="ButtonEditCAParameters_Click" Height="23" IsEnabled="{Binding IsParametersEnabled, Mode=TwoWay}" Visibility="{Binding IsParametersVisible, Mode=TwoWay}"/>
                        </StackPanel>

                        <StackPanel Grid.Row="1">
                            <sdk:Label Content="End of simulation Condition" IsEnabled="False" />
                            <sdk:Label Content="(Play Mode)" IsEnabled="False" />
                            <StackPanel Orientation="Horizontal">
                                <RadioButton x:Name="radioButtonEndSimulationAllStates" GroupName="GroupEndOfSimulationOption" Content="when all cell states are" IsChecked="True" IsEnabled="True" VerticalContentAlignment="Center" VerticalAlignment="Center" Checked="radioButtonEndSimulationAllStates_Checked" />
                                <my:BasicCellControl  Grid.Row="2" Grid.Column="5" SelectedCellStateTypeId="{Binding CurrentSimulation.SimulationEndConditionCellStateTypeId, Mode=TwoWay}" VerticalAlignment="Center" HorizontalAlignment="Center" Height="25" Width="29" />
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <RadioButton x:Name="radioButtonEndSimulationAfterNumberOfSteps" Content="after this number of steps " GroupName="GroupEndOfSimulationOption" VerticalContentAlignment="Center"  VerticalAlignment="Center" Checked="radioButtonEndSimulationAfterNumberOfSteps_Checked" />
                                <TextBox x:Name="TextboxEndSimulationNumberOfSteps" Width="40" Text="{Binding CurrentSimulation.SimulationEndConditionNumberOfSteps, Mode=TwoWay}"/>
                            </StackPanel>
                            <RadioButton x:Name="radioButtonEndSimulationInfinite" Content="Never Stops (Infinite)" GroupName="GroupEndOfSimulationOption" VerticalContentAlignment="Center"  VerticalAlignment="Center" Checked="radioButtonEndSimulationInfinite_Checked" />
                            <StackPanel Orientation="Horizontal" Grid.Row="2" >
                                <sdk:Label Content="Delay between Transition (s)" IsEnabled="False" Margin="20,0,0,0"/>
                                <TextBox x:Name="TextboxDelayTransition" Width="40" Text="{Binding CurrentSimulation.SimulationPlayModeTransitionTimeDelay, Mode=TwoWay}"/>

                            </StackPanel>
                        </StackPanel>





                        <StackPanel Grid.Row="2" Margin="0,20,0,0">
                            <sdk:Label Content="Addiontal Configuration" IsEnabled="False" />
                            <StackPanel Orientation="Horizontal">
                                <sdk:Label Content="Out-of-bound Cell's state" IsEnabled="False" />
                                <my:BasicCellControl  Grid.Row="2" Grid.Column="5" SelectedCellStateTypeId="{Binding CurrentSimulation.OutOfBoundCellStateTypeId, Mode=TwoWay}" VerticalAlignment="Center" HorizontalAlignment="Center" Height="25" Width="29" />
                            </StackPanel>
                        </StackPanel>

                    </Grid>
                </sdk:TabItem>
                <sdk:TabItem Header="Statistics" x:Name="TabItemStats">
                    <Grid x:Name="GridCellularAutomataInfo" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <!--<StackPanel Orientation="Vertical" Grid.Row="1">-->
                        <!--<sdk:Label Content="Current Values" IsEnabled="False"/>-->
                        <!--<StackPanel Orientation="Horizontal" Margin="20">
                                <sdk:Label Content="CA Width: " IsEnabled="False" Margin="20,0,0,0"/>
                                <TextBox Width="40" Text="{Binding CurrentSimulation.CellularAutomata.Width, Mode=TwoWay}" IsEnabled="False"/>
                                <sdk:Label Content="CA Height: " IsEnabled="False" Margin="20,0,0,0"/>
                                <TextBox Width="40" Text="{Binding CurrentSimulation.CellularAutomata.Height, Mode=TwoWay}" IsEnabled="False"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Margin="80,0,80,40">
                                <sdk:Label Content="# Cells: " IsEnabled="False" Margin="20,0,0,0"/>
                                <TextBox Width="40" Text="{Binding CurrentSimulation.TotalQuantityCells, Mode=TwoWay}" IsEnabled="False"/>
                            </StackPanel>-->
                        <!--</StackPanel>-->
                        <Grid HorizontalAlignment="Left" Height="205" Width="329">
                            <Grid HorizontalAlignment="Left" Height="300" Margin="0,-98,0,0" VerticalAlignment="Top" Width="329">
                                <Rectangle Fill="#484848" HorizontalAlignment="Left" Height="38" Margin="-15,84,-15,0" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="359"/>
                                <Rectangle Fill="White" Opacity="0.7" RadiusX="5" RadiusY="5" HorizontalAlignment="Left" Height="32" Margin="-12,87,-15,0" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="353"/>

                                <Rectangle Fill="#484848" HorizontalAlignment="Left" Height="50" RadiusX="10" RadiusY="10" Margin="27,168,0,0" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="275"/>
                                <Rectangle Fill="#0000ff" HorizontalAlignment="Left" Height="20" Margin="5,188,0,0" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="100"/>
                                <Rectangle Fill="#008000" HorizontalAlignment="Left" Height="20" Margin="115,188,0,0" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="100"/>
                                <Rectangle Fill="#ff0000" HorizontalAlignment="Left" Height="20" Margin="225,188,0,0" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="100"/>
                                <TextBlock HorizontalAlignment="Left" Height="20" Margin="44,189,0,0" TextWrapping="Wrap" Text="{Binding Path=CurrentSimulation.CurrentQuantityDecontaminatingCells, Mode=TwoWay}" VerticalAlignment="Top" Width="70" FontSize="12" FontWeight="Bold" Foreground="White"/>
                                <TextBlock HorizontalAlignment="Left" Height="20" Margin="154,189,0,0" TextWrapping="Wrap" Text="{Binding Path=CurrentSimulation.CurrentQuantityDecontaminatedCells, Mode=TwoWay}" VerticalAlignment="Top" Width="70" FontSize="12" FontWeight="Bold" Foreground="White"/>
                                <TextBlock HorizontalAlignment="Left" Height="20" Margin="264,189,-5,0" TextWrapping="Wrap" Text="{Binding Path=CurrentSimulation.CurrentQuantityContaminatedCells, Mode=TwoWay}" VerticalAlignment="Top" Width="70" FontSize="12" FontWeight="Bold" Foreground="White"/>
                                <Rectangle Fill="White" Opacity="0.8" HorizontalAlignment="Left" Height="20" Margin="27,168,0,0" Stroke="Black" StrokeThickness="0" VerticalAlignment="Top" Width="275"/>
                                <TextBlock HorizontalAlignment="Left" Height="20" Margin="36,169,0,0" TextWrapping="Wrap" Text="Progress in cells number visualization" VerticalAlignment="Top" Width="258" FontSize="12" FontWeight="Bold"/>



                                <Rectangle Fill="#484848" RadiusX="5" RadiusY="5" HorizontalAlignment="Left" Height="310" Margin="15,238,0,-248" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="300"/>
                                <Rectangle Fill="White" Opacity="0.8" HorizontalAlignment="Left" Height="33" Margin="18,240,0,0" Stroke="Black" StrokeThickness="0" VerticalAlignment="Top" Width="294"/>
                                <!--<Rectangle Fill="#484848"  Opacity="0.4" HorizontalAlignment="Left" Height="100" Margin="10,257,-101,-200" Stroke="Black" StrokeThickness="0" VerticalAlignment="Top" Width="300"/>
                                    <Rectangle Fill="#484848" Opacity="0.5" HorizontalAlignment="Left" Height="89" Margin="10,382,-101,-200" Stroke="Black" StrokeThickness="0" VerticalAlignment="Top" Width="300"/>-->
                                <Rectangle Fill="#fff" Opacity="0.5" HorizontalAlignment="Left" Height="271" Margin="34,0,0,-246" Stroke="White" StrokeThickness="0.5" VerticalAlignment="Bottom" Width="41"/>
                                <Rectangle Fill="#0000ff" HorizontalAlignment="Left" Height="{Binding Path=CurrentSimulation.CurrentQuantityDecontaminatingCellsZoom, Mode=TwoWay}" Margin="34,0,0,-246" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Bottom" Width="41"/>
                                <Rectangle Fill="#fff" Opacity="0.5" HorizontalAlignment="Left" Height="271" Margin="91,0,0,-246" Stroke="White" StrokeThickness="0.5" VerticalAlignment="Bottom" Width="41"/>
                                <Rectangle Fill="#008000" HorizontalAlignment="Left" Height="{Binding Path=CurrentSimulation.CurrentQuantityDecontaminatedCellsZoom, Mode=TwoWay}" Margin="91,0,0,-246" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Bottom" Width="41"/>
                                <Rectangle Fill="#fff" Opacity="0.5" HorizontalAlignment="Left" Height="271" Margin="148,0,0,-246" Stroke="White" StrokeThickness="0.5" VerticalAlignment="Bottom" Width="41"/>
                                <Rectangle Fill="#ff0000" HorizontalAlignment="Left" Height="{Binding Path=CurrentSimulation.CurrentQuantityContaminatedCellsZoom, Mode=TwoWay}" Margin="148,0,0,-246" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Bottom" Width="41"/>
                                <TextBlock HorizontalAlignment="Left" Height="20" Margin="32,278,0,-10" TextWrapping="Wrap" Text="{Binding Path=CurrentSimulation.CurrentQuantityDecontaminatingCellsPercentage, Mode=TwoWay}" VerticalAlignment="Top" Width="44" FontWeight="Bold"/>
                                <TextBlock HorizontalAlignment="Left" Height="32" Margin="47,295,0,-27" TextWrapping="Wrap" Text="%" VerticalAlignment="Top" Width="19" Foreground="#FF080000" FontWeight="Bold"/>

                                <TextBlock HorizontalAlignment="Left" Height="20" Margin="89,278,0,-10" TextWrapping="Wrap" Text="{Binding Path=CurrentSimulation.CurrentQuantityDecontaminatedCellsPercentage, Mode=TwoWay}" VerticalAlignment="Top" Width="44" FontWeight="Bold"/>
                                <TextBlock HorizontalAlignment="Left" Height="32" Margin="104,295,0,-27" TextWrapping="Wrap" Text="%" VerticalAlignment="Top" Width="19" Foreground="#FF080000" FontWeight="Bold"/>

                                <TextBlock HorizontalAlignment="Left" Height="20" Margin="146,278,0,0" TextWrapping="Wrap" Text="{Binding Path=CurrentSimulation.CurrentQuantityContaminatedCellsPercentage, Mode=TwoWay}" VerticalAlignment="Top" Width="44" FontWeight="Bold"/>
                                <TextBlock HorizontalAlignment="Left" Height="32" Margin="162,295,0,-27" TextWrapping="Wrap" Text="%" VerticalAlignment="Top" Width="19" Foreground="#FF080000" FontWeight="Bold"/>
                                <TextBlock HorizontalAlignment="Left" Height="23" Margin="42,247,0,0" TextWrapping="Wrap" Text="Progress in percentage visualization" VerticalAlignment="Top" Width="252" FontSize="12" FontWeight="Bold"/>
                                <TextBlock HorizontalAlignment="Left" Height="23" Margin="21,96,0,0" TextWrapping="Wrap" Text="CA width = " VerticalAlignment="Top" Width="90" FontSize="12" FontWeight="Bold"/>
                                <TextBlock HorizontalAlignment="Left" Height="23" Margin="98,96,0,0" TextWrapping="Wrap" Text="{Binding CurrentSimulation.CellularAutomata.Width, Mode=TwoWay}" VerticalAlignment="Top" Width="90" FontSize="12" FontWeight="Bold"/>
                                <TextBlock HorizontalAlignment="Left" Height="23" Margin="218,96,0,0" TextWrapping="Wrap" Text="CA height = " VerticalAlignment="Top" Width="90" FontSize="12" FontWeight="Bold"/>
                                <TextBlock HorizontalAlignment="Left" Height="23" Margin="299,96,-60,0" TextWrapping="Wrap" Text="{Binding CurrentSimulation.CellularAutomata.Height, Mode=TwoWay}" VerticalAlignment="Top" Width="90" FontSize="12" FontWeight="Bold"/>
                            </Grid>
                            <Rectangle Fill="#efeff2" HorizontalAlignment="Left" Height="57" Margin="213,347,0,-199" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="96"/>
                            <Rectangle Fill="#0000ff" HorizontalAlignment="Left" Height="10" Margin="217,351,0,-156" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="10"/>
                            <Rectangle Fill="#008000" HorizontalAlignment="Left" Height="10" Margin="217,371,0,-176" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="10"/>
                            <Rectangle Fill="#ff0000" HorizontalAlignment="Left" Height="10" Margin="217,391,0,-196" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="10"/>
                            <TextBlock HorizontalAlignment="Left" Height="13" Margin="232,350,0,-158" TextWrapping="Wrap" Text="Decontaminating" VerticalAlignment="Top" Width="78" FontSize="8"/>
                            <TextBlock HorizontalAlignment="Left" Height="13" Margin="232,370,0,-178" TextWrapping="Wrap" Text="Decontaminated" VerticalAlignment="Top" Width="78" FontSize="8"/>
                            <TextBlock HorizontalAlignment="Left" Height="13" Margin="232,390,0,-198" TextWrapping="Wrap" Text="Contaminated" VerticalAlignment="Top" Width="78" FontSize="8"/>


                            <!--<Rectangle Fill="#0000ff" HorizontalAlignment="Left" Height="10" Margin="234,50,0,0" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="10"/>
                                <Rectangle Fill="#008000" HorizontalAlignment="Left" Height="10" Margin="234,70,0,0" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="10"/>
                                <Rectangle Fill="#ff0000" HorizontalAlignment="Left" Height="10" Margin="234,90,0,0" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="10"/>-->
                        </Grid>
                        <Rectangle Fill="#484848" HorizontalAlignment="Left" Height="23" Margin="297,51,-9,0" Stroke="Black" StrokeThickness="0" VerticalAlignment="Top" Width="41"/>
                        <Rectangle Fill="White" Opacity="0.8" RadiusX="5" RadiusY="5" HorizontalAlignment="Left" Height="23" Margin="297,51,-9,0" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Top" Width="41"/>
                        <TextBlock HorizontalAlignment="Left" Height="23" Margin="302,56,-12,0" TextWrapping="Wrap" Text="{Binding CurrentSimulation.TotalQuantityCells, Mode=TwoWay}" VerticalAlignment="Top" Width="39" FontWeight="Bold"/>

                        <!--<StackPanel Orientation="Horizontal" Margin="20">
                                <sdk:Label Content="#Decontaminating cells " IsEnabled="False" Margin="20,0,0,0"/>
                                <TextBox Width="40" Text="{Binding Path=CurrentSimulation.CurrentQuantityDecontaminatingCells, Mode=TwoWay}" IsEnabled="False"/>
                                <TextBox Width="40" Text="TBD" IsEnabled="False"/>
                                <sdk:Label Content="%" IsEnabled="False"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Margin="20">
                                <sdk:Label Content="#Decontaminated cells " IsEnabled="False" Margin="20,0,0,0"/>
                                <TextBox Width="40" Text="{Binding Path=CurrentSimulation.CurrentQuantityDecontaminatedCells, Mode=TwoWay}" IsEnabled="False"/>
                                <TextBox Width="40" Text="TBD" IsEnabled="False"/>
                                <sdk:Label Content="%" IsEnabled="False"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Margin="20">
                                <sdk:Label Content="#Contaminated cells " IsEnabled="False" Margin="20,0,0,0"/>
                                <TextBox Width="40" Text="{Binding Path=CurrentSimulation.CurrentQuantityContaminatedCells, Mode=TwoWay}" IsEnabled="False"/>
                                <TextBox Width="40" Text="TBD" IsEnabled="False"/>
                                <sdk:Label Content="%" IsEnabled="False"/>
                            </StackPanel>-->




                    </Grid>
                </sdk:TabItem>
            </sdk:TabControl>
        </Grid>
        <Button Click="SetGridVisible_Click" Content="Subdivide network" HorizontalAlignment="Left" Height="22" Margin="474,0,0,0" VerticalAlignment="Top" Width="110" Visibility="{Binding IsSubdividingButtonVisible, Mode=TwoWay}"/>
        <!--</ScrollViewer>-->
        <Grid Background="White" Opacity="0.9" x:Name="GridPartition" HorizontalAlignment="Center" Height="42" Margin="10,0,279,0" VerticalAlignment="Top" Width="551" Visibility="{Binding IsSubdividingVisible, Mode=TwoWay}" Grid.Row="1">
            <TextBlock HorizontalAlignment="Left" Height="26" TextWrapping="Wrap" Text="Click on the cells to divide the network (Fix two corner cells of partition)" VerticalAlignment="Top" Width="456" FontWeight="Bold"/>
            <Button Click="Subdivide_Click" Content="ok" HorizontalAlignment="Left" Height="19" Margin="401,20,0,0" VerticalAlignment="Top" Width="46"/>
            <Button Content="Cancel" HorizontalAlignment="Left" Height="19" Margin="307,20,0,0" VerticalAlignment="Top" Width="46" Click="SetGridInvisible_Click"/>
            <Button Content="Back" Name="back" HorizontalAlignment="Left" Height="19" Margin="354,20,0,0" VerticalAlignment="Top" Width="46" Click="ButtonBack_Click" IsEnabled="{Binding IsButtonBackEnabled, Mode=TwoWay}"/>
            <!--<ComboBox HorizontalAlignment="Left" Height="19" Margin="448,20,0,0" VerticalAlignment="Top" Width="103" RenderTransformOrigin="0.244,0.545" Name="combo" ItemsSource="{Binding}" SelectionChanged="combo_SelectionChanged"/>-->
            <!--<Button Content="Cancel" HorizontalAlignment="Left" Height="19" Margin="374,31,0,0" VerticalAlignment="Top" Width="46"/>-->
        </Grid>



    </Grid>

</navigation:Page>